package com.huabo.contract.oracle.mapper;

import com.huabo.contract.oracle.entity.TblFlow;

import java.math.BigDecimal;

import com.huabo.contract.oracle.entity.TblFormControllog;
import org.apache.ibatis.annotations.*;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huabo
 * @since 2021-10-23
 */
public interface TblFlowMapper extends BaseMapper<TblFlow> {

	@Select("SELECT * FROM TBL_FLOW WHERE FLOWID = #{flowId}")
	TblFlow findFlowInfoById(@Param("flowId") String flowId) throws Exception;

	@Select("SELECT * FROM TBL_FLOW WHERE FLOWNUMBER = #{flowNumber} AND COMPANY = #{orgId}")
	TblFlow findFlowInfoByFlowNumber(@Param("flowNumber")String flowNumber,@Param("orgId") BigDecimal orgId);

	@Select("SELECT * FROM TBL_FLOW WHERE FLOWID = #{flowid}")
	@Options(useGeneratedKeys=true, keyProperty="flowid", keyColumn="FLOWID")
    TblFlow findByFlowid(String flowid);

	@Select("SELECT * FROM TBL_FLOW WHERE FLOWID = #{flowid}")
	TblFlow findByFlow(String flowid);

	@Select("SELECT * FROM TBL_FLOW WHERE FLOWID = #{flowid}")
	TblFlow findFlowid(BigDecimal flowid);

	@InsertProvider(type=TblFlowMapperSqlConfig.class,method="saveTfl")
    void saveTfl(TblFormControllog tfl);

	@UpdateProvider(type=TblFlowMapperSqlConfig.class,method="updateTfl")
	void updateTfl(TblFormControllog tfl);

	@Select("SELECT * FROM TBL_FLOW WHERE FLOWID = #{flowid}")
	String selectFlowid(BigDecimal flowId);

	@Select("SELECT * FROM TBL_FLOW WHERE FLOWID = #{flowid}")
    TblFlow findById(String flowid);
}
